module RoomsHelper
  def create(obj)
    if obj.errors.size==0
      page['errors'].hide()
      page.insert_html :bottom, "room_list", :partial=>"room_item",:locals=>{:room=>obj}
      page["room_#{obj.id}"].visual_effect :highlight
      page.form.reset "room_form"
    else
      page['errors'].show()
      page.replace_html 'errors',error_messages(obj)
      page.visual_effect :highlight,'errors'
    end
  end
end
